Add support for using F() expressions in CounterField initialization.

CounterField intializers can now return a F() expression in the
initializer function, or provide the expression instead of a function,
instead of returning a numeric value. These will be passed to the
database query, allowing for atomic computation of initial counter
state.

Since we didn't have unit tests for CounterField before, this comes with
a set of tests for the new functionality and much of the original
functionality.

Reviewed at https://reviews.reviewboard.org/r/6242/