Code cleanup. Created YZ and Royal classes. Added logging royals to the database, and restructured royals_code to use the database values.