Implement input plugin for PostGIS Rasters

Closes #1660.
Includes python bindings and testcases.

Superceeds #2288, being a rebased version of it.