added some includes and tried to put some database stuff in

Signed-off-by: Jeff Wells <jeff.wells@jobing.com>