Refactor directory filters to eliminate duplicated items

Instead of dynamically prepending the currently selected option to the
<select>, we now correctly use the "selected" attribute.

See #812