make new branch
Sets a tiPageType global for js using Flask template vars.

These are set with a dict in in views_helpers.py, to make the categories
easy to change and add to later if we want. The g.page_type global is injected
into all templates just before they are rendered.

The only potentially fragile thing about this is that it looks up page types based on
profile names, so if you change those it breaks. Had to decide whether to look up
based on 1) template names, 2) url paths, or 3) view function names. All had pros
and cons; happy to change (tho not sure how to do [3] actually).

Fixes #70, since we detect profiles base on use of the user-profile.html template.
Pageload reporting seems to be working with analytics.ready() callback.

Need to test that it's actually getting sent correctly, but it's not throwing
errors any more at least. Fixes #74, although more testing needed.

Also, realized the page_type code does not belong in Python...it's really
just an analytics issue that the client should be dealing with. tore out
the python that found analytics and replaced it with js. Much tidier.
Fix double-spaces in and around body classes declaration.

I think these cause some browsers to not parse the classes
properly.
Fix bug causing ASCII-looking strings to be handled as str, not unicode.

Pretty serious; was causing profiles to fail unless name had a code point >128.
Yikes.