Added JS minification and made the RMI slightly more sophisticated.