Better selection method

Fixes #3 (added database to make sort order important also fixed file extensions)