Add register_shutdown function is most accurate

It's good function with Twig. You can choose position on HTML code, or just add on end file, when php code shutdown (terminate).
Use param of JavascriptRenderer constructor.

I add baseUrl, basePath parameters to getJavascriptRenderer(...) for increased use speed.

Save two lines of code.

I am lazy :)
Update mistake.
Small changes & prevent exception
Fix last commit (old version).
Merge pull request #55 from GuimDev/master

Add register_shutdown function is most accurate (and support Twig)