Added dependencies, some refactoring
Merge pull request #10 from jankroken/master

some refactoring (thanks iXeno)