add tests, change module structure, api.