robot-framework: Refactor test_module to use more modern APIs

Makes it simpler as well...