Add support for extension filters for file dialogs

Fixes #450.