Move tests to this module and restructure for new module structure.