Use Erlang QuickCheck over proper.

While here, extract code out of the main module and into separate test code for the project.