Implemented static factory methods, added more tests.