Refactor ONS import, add a couple of tests