Develop

First version is now working. See comment under the issue in the issue trackers for minor TODOs.