new test for question/category, re-factor handling and fix bugs to make the test pass
forgot the test in the last commit