Refactor Group and Role model classes to be activerecord