Optimize and update data manager docs

Move repeated code to common function
Update missing and misleading comments
Fix data manager test compile errors
No functional changes