rewrite
Updated license. Cleaned up tests.