make conses thread safe

@radumereuta please review
Then how do you establish what number to assign to each definition?