The evolution of hyperboloidal data with the dual foliation formalism: mathematical analysis and wave equation tests