Trim newlines off the end of returned output
Added PHPUnit Test Suite