Added code to put rules in the database. Stopped rule object being a subclass of component as it's something different