Revert "Changed how BASE communicates with the database object. Instead of storing it in a new variable it is now just passing it through a function to save time and memory. Hopefully this is a more efficient way.."

This reverts commit 877075214ee597e43156ffe757ba68c47c9671c8.