Define interface

This adds the definition of the public interface. Comments welcome!

@neithernut 
Yes, also a minor fix which can go in later.