make conses thread safe

@radumereuta please review
each definition has their own context. Each context has their own counter. Each counter starts at 0 and is incremented whenever this function is called. All of these things are in the diff. The only thing that has changed is the fact that the field is now an instance field on Context instead of being static.