Move methods defined in spec/support to modules

It is ill-advised to create global methods even if they are only defined in test-land.