Added mixpanel, and added event tracking.

Used jquery.when to handle async nature of event tracking code,
otherwise may lose it if redirect triggers too soon.