A number of unittests added. Not all of them are fully implemented.