Refactor nav directive

Move the nav into its own directive, just to tidy up the index.html. (Also, rename 'masterController' as 'globalController'.)