Merging in moves hotfix.
Added a few useful functions for testing and manipulation of states.
this merges in changes from masters making this ready to merge