v5 Code Cleanup for DbAdapter and Others

Cleaned up all current code for branch merge.