Refactor freebase unit tests
Unit test for #82