Push intermediate work...

Still needs some tweaks and testing.
Merge pull request #1 from svanharmelen/master

Push intermediate work...