added function main(){} interface to workers (close #91)