Fix checkboxes so the value can actually be set

Previously the value was being set with .attr, which doesn't actually
set the value; now setting with .prop.

Also some minor code clean-up.

Change-Id: I7a6ae5a5872a85bee1026ce68d10f3da06bdc8b8