LUN-1114 -- moved caption formating in its own js file