Merge pull request #10 from ensonic/master

Small code reorganisation and cleanups.