Create Misc.php

This file contains small functions used in the whole system.