Added database methods for Conditions and Actions. Made SQL easier to read for Events.