convert instance variables and methods within a controller to
$scope variables.  Fix 'functions' to ensure all nodes are processed.