Move DatabaseWrapper to its own file