Persist ui flow & unit tests

- Also fix some existing unit tests

Fix for https://github.com/Rise-Vision/angular-ui-flow-manager/issues/2