Database connection

Added connection test.
Added session.