Removed common code and moved it to the common repository. General structure cleanup.