Merge pull request #24 from grtjn/master

roughly implemented #9, fixed #20, mostly implemented #21, and #22 should work, but wont
Merge pull request #25 from grtjn/master

Fix for #21