Moved service, client and common code into separate modules.