Move code out of module level in example.py
Add doctests to travis ci and a few other packages that could be installed via apt-get, potentially.