Use the configured default extension

Right now the code does not take defaultExtension into account.
Merge pull request #11 from juggy/patch-1

Use the configured default extension