Make navigation slightly more functional.

Also stuck in some style/best practice changes.