Refactoring: Code cleanup

Since my editor (Sublime Text) permanently complains I decided to clean the code up a bit.

I replaced space-tabs by actual tabs, removed trailing spaces, aligned code and adjusted existing documentation to PHPDoc standards.

I tryed to respect your code style, trough. Let me know if something doesn't fit :)