Refactoring magneto server startup into util.before function, refactoring shouldThrow and shouldNotThrow helpers into util