Divide mod.rs into lib.rs and resource.rs and add some failing tests