Use sql.query instead of sql.open/conn.query

This is a bit of a shortcut, but the readability of the code is
greatly improved.
Print node version and environment architecture