merged kevin mark and sisuns changes to finalize sleep log and database features