Added node.assign_types method

Converted --types flag in demo_calculator to use this method.