Applied changes from code review
fixed variable declaration

in emulateTransitionEnd, i was declaring duration when it was already
being passed as an argument (thanks jshint)
removed whitespace that was failing jscs