A shitty, manually tested implementation of williams factorization method.