All sorts of updates

Added better typing. Damn near everything is a template.