Added more debug logging.
Removed console.log calls from code.
More unit testing #10.