- replace deprecated command "ns_unlink" with native tcl command "file delete"
- update postgres function to modern style plpgsql definitions using dollar quoting