added a to_hash convenience method to transition

This is useful to be used in scenarios where we get a cucumber table with data to compare.
Also added specs for [] with it seems I forgot the last time , oops.

@chad-medi  @cabbott