The 0 and pi contact array model of bicrystal junctions and interferometers