Add in some module_render tests

Refactor xqueue_callback to make it more testable.