Get file extension by using extname module

Fixes #11.