Rename main() to initialize().
Add exception test.
Add terminate test.