Adding bulk of source code and tests.