tests creating a 'factory' function

- implements an init process that tries to determine the environment and
inits a proper object accordingly.
starts to decouple generic methods from application specific methods