Add segment.io analytics

To be honest, I don't understand it all (I haven't really looked much).  All I know is it queues up any calls to the object before the object is instantiated, then works through the queue.  That way, you ensure you don't have a script error because you are making calls before the analytics object is set up.  I'll try to explain that in my comments.  
As far as I know, it is all just boilerplate stuff.