Removed a lot of duplicate code from Facebook tests.