Code: Simpler approach to evaluate variables

* Rehashed Flatten() method's logic.
* Removed ncalc dependency.