Propagate the type of "count" operations through the query compiler.

"length" methods are typed as Int (for compatibility with Scala
collections) but internally we'd like to use Long in some cases (and also
keep our options open of adding extra methods like "longLength" later).
The query compiler used to assume Long in some places when transforming
Count aggregation operations which was swept under the rug with the old
type encoding (which just ignored these internal types in the AST) but now
that we're using the AST types, it blows up with ClassCastExceptions. This
commit changes the query compiler to always propagate the original type
instead of assuming Long, so it will work with any integral type.

Partially fixes Assembla ticket 150. Test in AggregateTest.testIntLength
(distilled from FirstExample in doctest).
Update the syntax used by the documentation snippets.

Partially fixes Assembla ticket 150.
Merge pull request #128 from slick/tmp/fix-doctests

Fix doctest:test bugs