First pass of a new API

An attempt at the new api for #9