add DRUPAL_ROOT constant for d7
replace db_query() and db_fetch_object() with db_select() for d7
clean up comments
change success message