Restructure code to gem format.
Fix pull conflicts.