Tentative interface

The exported functions are tentatively the interface for other packages to use.  I've left a lot of TODOs / questions in the file, so please comment away.