cgi does not like type as field name
change interface so it allows reuse tasks
use wtype
fix memory leaks
memory test