Adds support for having both condition and history states on the same
state. The condition function is consulted first and then the history state
is used if the condition function returns null.
Adds ability to pass a function to the State constructor that will be
invoked in the context of the newly created state.