finished states

getStates now mixes in default states and user states. added cache to
get Database, remove cache on set DB