Revamped template loading

Ping @mahmoudimus @bninja @mjallday