Some tweaks around $state.transition plus more tests (#41)