Make TokenElement immutable

Ref #279.