Reorganize module.
Add some code for testing.