Move general knockout widget code to separate component