update functions

adding mysqli_free_result where needed and imposing consistent
tushka-style indenting.  i.e. minimal.  :)