CartoDB PostgreSQL extension versioning more flexible based on semver

cc/ @Kartones @lbosque @javisantana 
I added some tests for current scenarios to ensure we can release the cartodb/rails part without requiring an upgrade in the extension.

Next minor version of the extension will start reporting just the version without the revision as in https://github.com/CartoDB/cartodb-postgresql/compare/CDB-3504 That's also tested here.
This ensures that is compatible with current versions strings.