Enhancements and bug fixes

* Completed functionality of basename and dirname.
* A few fixes to the recently introduced wc