extended test case
move doctests into tested functions
minor test cleanup
add failing Py3 exception test