Added email stuff
Added database stuff
Added entry point for console script