BibClassify: new API

* Adds a new API module for use by workflow tasks.

* Several updates and fixes to the module to improve output.

* Moves a function for easier future optimization,
  simplifying some operations.

Tested-by: Jan Aage Lavik <jan.age.lavik@cern.ch>