Refactored camresolutiontest to a single class

Sorry for the extra commits, sloppy!
It is confusing to have extra code being executed between the constructor function and the function prototype.
can you move this to be executed before the function definition?

Note: javascript functions are not like C, all of symbols are defined the moment the code starts execution on that scope.