update index.php
fixed exception when no hooks available
fixed crash when running from cli
no more return object sometimes
more extensive information, also hook support
end of line char after JSON