Extract code block into its own method.

Change-Id: I4cb450afee9200ce749356b6a4bda8f046da305f
Use struct to group together parameters to reduce number of method args.

And to make it easier to share common parameters between methods.

Change-Id: Ibdbad66ea8f2f30b4518f9ecaec2f43087c54837
Scope reduction by early bailout.

Change-Id: If66f732265505a97990cf6c75ff53797a1d91b7a
Aligh this correctly...

Also use 4-char tab space etc.

Change-Id: I5ca007f58a588823ce9961af154cd97c25dd6f9b
Apply a simple pimpl idiom and rename the old Impl to make it non-Impl.

The old Impl instance is ref-counted, which I'd like to convert to using
boost::intrusive_ptr.  But to make it happen, we need to really hide this
from public header...

Change-Id: I1f1e9e500f2112eea04e3e6d661a7dfa74655c62
Use boost::intrusive_ptr in lieu of manual ref-counting.

Change-Id: I0a29a1e490f5aa52a9057be71164573e403affe9