Major Refactor, Added ability to invert switches

Changed around the way templates are filled
Lots of refactoring
Added ability to invert a line switch and stack multiple switches