Upgraded Gems and reworked rake tasks

Getting things into a maintainable state again.