Add struct Database with Init, Test, Close, GetHandle methods
Update code in main to use the Database type