lib: Establish tests.
trivia: Clean up imports.
trivia: Factor out some chat stuff.

Just to get my fingers wet.
trivia: Fix star import.
lib, trivia: Fix tabs and trailing whitespace.
Merged Corbin's changes. Fixed a small bug.