Application structure refactoring, added notifications to view_referral, fixed PDF generation (and added teeth list)