Added checks and debugger

now functions as expected when given null values or when database is
used while closed.
Added debugger class to help visualize cached and stored objects