integrate necessary functions from external libs of same author, remove demo and tests
further clean up and script to build a jar file out of the src and classes.