add option to have extension as key, fixes #2
add test