Move demo js to separate file
Demo code cleanup