Stop throwing "Can't render headers after they are sent to the client."

Fixes #49 

This branch is a work in progress. So far just a failing test case