Refactor factorizer.

This pull request is a rewrite of the `Factorizer` to improve performance. The biggest change is that a single writer transaction is used for everything now. This improved the performance by 

```
BenchmarkFactorizer	    2000	   1450791 ns/op
BenchmarkFactorizer	   50000	     36662 ns/op
BenchmarkFactorizer	  200000	      9797 ns/op
```