Clean up cgi-endpoint
Update test cases
Tidy up CGI handler
Remove shell wrapper