Added more tests of the functional API.
Breaking change to functional API (param order).

getAvailableEvents & getNewState - moved transitions to first parameter
for partial application. This allows F# clients to store the transitions
along with the function.