Added util.php with util functions and added documentation