NEW: Starting to implement unit tests.
Work in progress.