Better design for the StateMachine class

Now you set up a prototypical StateMachine and copy it to create as many
instances as you need.

This means there's no need for the StateMachineContext object and that
we also don't need to do all that checking and copying of properties (most
of the time).

I've taken transitions out for now too. I think a better approach might be to
provide helper functions which check some predefined condition and call
changeState, e.g. a changeStateIfKeyDown function and so on.

Update the unit tests to match the new class structure too and now there's
a test for every public method in the class (except for the construtor).
Simplify gameloop.js using the update StateMachine class
Remove per-state userData.

I'm not convinced it's necessary. I'll add it back in later if I turn out to be
wrong. Also, updated the tests to reflect this change.
Commit the test changes that should have been in the previous commit.