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.

I've merged with your master as of today, so everything you added since I forked should be included already