Major API change; add tests