Resolved duplicate package declaration error

Also simplified os lookup for packages.

Comment for mailplugins regarding undef

Fixed messed-up pathing for files and destinations.

Template wasn't generating correctly.

changed <% @whatever -%> to <%= @whatever %>.