Moved unit test to separate file. Made use of unittest module.

Some of the test cases don't really test anything yet. We can add another test case later that doesn't require phones, and instead uses simulated XML as Nick suggested.