Moved radio and checkbox functionality into a mixin for better reuse.