Permalink refactoring and tests, new header view and tests, moving view els for clarity, fixing browser spec runner