cleanup API

- support legacy methods and variables
- make logging internal to library
- add flag for debugging