Refactor MainLoop to not inherit from Thread
Create MainLoop thread through a thread factory

Environments such as GAE can provide their own
factories that use, say, custom restricted
thread managers.
Don't instantiate threads directly in two more places
Thread factory should be set via ConnectionFactory
Typo
Only modify threads if allowed to by the environment
Prepare heartbeat sender to use our own thread factory
merge bug14587 into bug25999
merge bug14587 into bug25999
Initialize heartbeat sender in #start

This gives ConnectionFactory a chance to
set a ThreadFactory first.
Security manager instantiation is also prohibited on GAE
Make ConsumerWorkService use connection's ThreadFactory
Remove unused import
merge bug14587 into bug25999
merge default into bug25999
merge default into bug25999
merge default into bug25999
Move thread factory to connection params
merge default into bug25999
Remove conflict markers in JavaDocs