Flesh out open and close tests a bit more
Makes unit tests use module and fixes issue found by doing this