Added a bunch of unit tests (code coverage: 81%)

This is an ongoing effort to improve the code quality of
easybook. The target is to define tests for every important
part in order to create a rock-solid application.

Once the tests are defined, easybook development could be
accelerated with confidence.