Also fixes import ordering (previously, local imports weren't grouped together as they should have been)