See #2

Added more tests
Fixed the factory problem
Added pre-test regex