Merging webmachine flow from in-progress

+ webmachine flow completed (see priv/webmachine.yml for more details)
+ tests for web machine flow
* several small bug fixes