Changed version numbering to PEP 440.

See http://www.python.org/dev/peps/pep-0440/
The version numbering doesn't exactly match the PEP, as it's still date
based, but it's closer.
Also improved regeneration of version.py by setup.py.