Generate the login/logout link server-side instead of with javascript.

I added a template variable `loggedinuser :: String` which is set to the name of the logged in user if there is a user logged in, and is unset otherwise.

This means the login/logout links in the userbox can be generated server-side now, and the javascript previously used is redundant. I changed the userbox code and removed the javascript accordingly.

This techically changes the public API, as `filledPageTemplate` now takes a `Maybe User` argument which it didn't take previously. Probably the version in gitit.cabal should be bumped if this change is to be merged.
`hasmessages` not necessary after all, got `$if(messages)$` working

I realised now that `hasmessages` is not necessary after all. I modified `filledPageTemplate` to only set the `messages` template variable when `pgMessages` is non-empty.

Now the `$if(messages)$` conditional in the original `content.st` works as expected, so this commit switches that back to the original.
Merge branch 'isloggedin'
Merge branch 'hasmessages'
Merge branch 'discussionUrl'