Break item template into separate file, clean up JS files