Several new changes

Moved table generation into new function
Added ability to have a dif user and connect directly to db already
created