added basic cgi functionality (no env vars passed, minimal error checking)