new functions and fixes

I've added a number of ST_* functions for PostGIS as well as a few fixes that you might want to review first.