make OS-specific instructions only appear for that OS

Did a bit of refactoring and cleanup while I was at it.