fix some syntax in the database functions.

since introduction of the query wrapper $cid (connection id) has
been deprecated.
issue #10

remove db_* calls from the code
put db_* functions into commands.php and remove PDO.php
replace wrappers with direct db_ code
db_* calls should just be used inside commands.php