Add simple JS templates engine, remove unused JS code