Pipelines now have a __len__() method.

The length of a pipeline is defined as the length of its command
stack.  This makes it easy to inspect the number of batched commands
and to write conditional logic for empty pipelines.
Merge pull request #309 from jparise/pipeline-length

Pipelines now have a __len__() method.
Merge remote-tracking branch 'andy/master'