Move more unit test helpers to testfx, so they can be used by modules
Fixes for custom rule variable error handling