Generate page title from tab's text

Move some of the javascript into its own file to reduce the amount of
javascript in the templates.

put the application bane in lib/MarkdownSite.pm so it's easier to change.