Factors

Added more logic for factorizations, but this is a halfway point
checkin.