Fix tests for factory methods.

Due to the way the factory tests were being set up, they were not being run properly. This pull request fixes that.

Because the gocheck context was being passed to the NewFactory method during test setup, assertions in factory methods were not being properly handled during actual tests. This resulted in some code being broken, but not immediately obviously so.
why did you move this from here to the prelude of each test ? The only inputs to the factory are State and a C, both of which are defined at SetUpTest time.