Added htmlup template, tidied the typescript a bit