added proper suppor for 404 and 500, with pages

Implemented 404 and 500 error pages, instead of just printing out
plaintext