A new and much more powerful API

refs: #2