Initial implementation of API. Untested, needs documentation.
Added package info/setup. Bug fixes