Expose methods required to create custom/external serve()

...serve() method

I have done this in order create my own serve() method. The method I have created is based on the existing one but has been altered to be compatible with CodeIgniter which manages output itself thus preventing the use of echo and header();