Implement strong types for forall and factor, fixes #63