Camera module gets disabled after 1 frame

Experimental changes (untested).
Modified Comparator and Counter modules to be more generic and reusable.
Counts the number of clock outs from camera module and disables it after
the number of expected cylces is reached using the comparator and
counter modules.