Add karma package to Node install
Fix permissions check bug

There was a bug in the logic of the 'hasPermission' helper function.
Move gaAccount variable to app.locals

This is the same for all requests, so we can simply set it in
app.locals. I left the sample middleware to set different account codes
for each domain, in case we want to use them.