Refactor more, and test JsonCaseBallot.to_jsobj().
Add test_internal.py.