Remove debug statements.  Bugfixes.  Add test API. #0