Rftests (WIP)

This is the unit test patch.