added a function which finds the path to the script's root directory, it is currently used for the templateUrl