Major changes to classes, defines and templates

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>