Multiple bug fixes.

Fixed agents and templates creation.
Create user folder on sign up.
Run all agents on boot.
Fixed file write/append template.
Fixed mail sending template.
Refactoring.