Complete refactor into rubygem