Move monkey patches out & expand tests.