Trait based typing system for Javascript