Allow none for root_stage.
Add ref destructor to remove name from moa.
Add loop param to clear to only clear for loop.
Fix to_bool to accept 0.