Added .htaccess to handle queries, clean URIs

* Added .htaccess to handle queries, clean URIs
* Better url handling in JavaScript