Lots of refactoring

JS Templates
Variable Refactors