Fix issue with Insight URLs in mandrill emails

The application_url used in the template was not being set before rendering
the insights fragment.

Also added test that the a url containing the host/?u= is in the insights
param sent to mandrill.

This is another fix for #1787 - You'd think that URLs wouldn't be so complicated. ;)