Killed all the compilation warnings

added types to vars etc. 
Also added ...args to functions that are callbacks for ()* regexps because if I add arg types and func gets wrong number of args it crashes.