add trackEvent method

I added access to the trackEvent method, and refactored the other methods a little bit. This queues up updates, events etc. until intercom has booted.

Auto-formatted the code as well, I much prefer it this way, but I could revert to the old indent/formatting if it's an issue.