Quantum phase transitions and coherent tunneling in a bilayer of ultracold atoms with dipole interactions