Core rewrite from single monster javascript app to seperate php pages