Add doctests
Add Python 3 compatibility
Modify test command for Python 3
Add missing raw string literal
Clean up