Add Google Analytics code [JOINDIN-303]

Also made some small other changes, so that I could make this happen:
- Send the app environment (whether in dev or live mode) to the template using variable joindin_env without needing to send it from the controller (the main template doesn't have a controller)
- This also means we can change the way we check the environment in previous code, so I've done that
- Moved JS to the bottom of the page for quicker loading times (and as recommended by Google Analytics implementation advice), and renamed the codeblock so it remains semantic