stop using CGI and eval

ref #318