Testcases

* Migrated build script to gradle
* Added a lot of test cases for the `Util` class
* Re-factored some methods in the `Util` class to make it easier to write test cases for them