Added tests and started documentation