Initial commit of code imported from Xowap/PHP-Serial and translated into PHP5