add crit class.  fix some scoping issues (missing "var"s)
make a generic criterion class

add tests for criteria
criteria are only compatible with other criteria of the same type.

fun with prototypes -- this could get me in trouble...
broke something...