Decode filename, allow multiple extensions. Fixes #6, fixes #7.