Add Crashlytics. Bounty #43

Plus a few other bits to tidy up the code.