Make pass ES5 strict mode + clean up

Used forEach to clean up the bar drawing.