Updated history/calendar to use content provider, code cleanup