Append .min to js/css files if minified

- generate_files() was checking the wrong parameter to determine whether
to append .min to the file name, the $type parameter can likely be
removed
- JS files would only work with JS minification if they were added with
.min as part of the original file name
- CSS minification was broken by the generate_files() fix, so adjusted
the behavior to match JS minification