Add __version__ (and generate it if necessary)

This is primarily useful for builders to generate a version, and for
users to have version information for the SDK itself.

This also avoids having to manually replace the version string for each
release

Change-Id: Ie05f4a3b48ab277f62276b923a841cfe04236dd0
Reviewed-on: http://review.couchbase.org/27092
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>