Code formatting, fixes, php doc and execution of test cases