Merge and update refactoring

Merged refactored code with delete code that wasn't included in
refactoring, database functions all updated for consistent
capitalization