Removed __construct() and getId() methods into zophTable.inc wherever possible

The previous change makes it possible to move __construct() and getId()
methods for any object that has a single, numeric primary key (Id) into
the master object zophTable.
Added some unittests for CLI

Created some unittests for the CLI, made small modifications to CLI code
to improve testability.

Split helpers into separate file