Some fixes to comply better with coding standards (PSR-2).

- Converted tab indentation to spaces
- Changed syntax of several if / else statements
- Added / adapted phpUnit annotations