Fixed missing require statements in factory tests, fixed factory class methods to include self, finished factory tests