Refactor ruby classes into multiple files.
Revert previous commit.