Added Factory tests, ready for pull request