Added namespace.
Adapted the code to  PSR-1.
Added singleton to avoid global use.
Merge pull request #1 from jmartin82/code_refactor

Added namespace.