Removed unused argument from callback function.
Used Array().split for URL parts extraction.
Moved global 'types' into filter queue.
Rephrased mis-leading comment.
Added name property to type selection checkbox.

This way I don't have to extract it from the type array.
Added 'filter_documents' helper function.

With this little gem, the client keeps a history of filter-queries, each more
restrictive than the previous one. Special care has been taken to detect
identical filters and remove redundant layers.
There is a more thorough explanation in the comments.
Added filter form change callbacks.

These are now very easy to read. Hooray for me!!!