IE compatability

Added oldie.js to add required array methods for older versions of IE.
Minor clean up of state machine code.