remove duplicate code through OO trickery
partially fix tests
Merge branch 'dev' of github.com:lintubongarit/sulka into dev