Add support for specify extension filters for file dialogs

Fixes #450.