I am still testing this and I wouldn't be surprised if there are still some bugs, but I think the obvious problems are gone now.
Please don't merge yet, but you can start testing.
Closes #202 (closed)
Closes #200 (closed)
This will create a new commit in order to revert the existing changes.