Use modern unittest; fix wonky formatting.
Add missing tests.