General script minification and optimization