Initial commit, should be quite usable, it also includes some unittests.