Working tests. Still some refactoring to do. Oh, and the python3 versions...