Added pagelist generation
Pull out .php pages from response bodies
Added write_output function