Added tests, simple logging and documentation