Add JS in pac_init().

Provide the Javascript code implementing findProxyForUrl() to
pac_init().
Print to console if error happens.
Move test JS files and test_pac to tests/.
Add test.
Update .gitignore.