Use the tools library to determine file extension
The previous code determined the extension by splitting the file path on a dot (.), which failed when the file path contains dots in folder names.
This commit fixes issue #14 (closed)
This is being merged into master early since it breaks gitlab testing for tagged releases (since the version string contains dots).