Fixing some line order to be more natural
Adds extra date functions for email templates
Adding more restriction for securities.