RF

Major refactoring to make the code more event driven. Some classes have
been renamed for clarity. DB changes have also been made, for clarity.