more specific pagemod match, check for null rather than typeof, stopped parsing ajax which already returns an object, use app not www, some restructuring and minor stuff