Moved some duplicate code to the nbclassify package

Also added an exceptions module for custom exceptions. And improved some output.