Make setup importable.

Also define versiondata variable for use with sphinx.
Initialize extension module only when main.

Do not perform shared library search when imported.
Prepare for separate source and build directories.
Update for latest sphinx, obtain version from setup.py.
Use sphinx generated version.

And also add publish target for pushing to gh-pages branch on GitHub.
Adjust for the new source-file location.