fix id splitting, and template replaces to global vs single (woops, silly javascript)