Don't dwell to much on the militia part. In the current SCOTUS reading, the RTKBA in the 2nd is an individual right, not tied to, or dependent on, a militia. That means the militia phrase is parenthetical... sort of like "oh by the way..."
The best way to explain it is an essay written by I don't remember that I read some time ago... If the Bill of Rights had an amendment that said
"A well educated electorate being necessary to the functioning of the state, the peoples right to keep and read books shall not be infringed"... This would mean that owning, purchasing, bartering, reading, and collecting books is an individual right for all citizens. Not just those eligible to vote, or those who do vote. Being part of the electorate or participating in elections is not tied in any way to the right to books. I have always liked this analogy by the way... and I wish I could remember who came up with it. It has served me well over the years when arguing with the self righteous ignoramuses.