More improvements to template and package generation. Work on CLI interface.