Add testcases for referer and refactor check_referer()
Remove fake_in_array since it is no longer called