Add variable term count support for main-gcu.
Factored out common operations from get_gcu_term_size() into balance_dimension().
Further factoring and simplification of get_gcu_term_size().
Merge myshkin's many-terms feature for the GCU port

* myshkin/gcu_many_terms:
  Further factoring and simplification of get_gcu_term_size().
  Factored out common operations from get_gcu_term_size() into balance_dimension().
  Add variable term count support for main-gcu.