Moved daemon hygiene action in the chain

It should be executed after the result is sent to the client otherwise we cannot take advantage of doing full gc() when the daemon is idle and not serving any build.
Added missing coverage and internal docs
Added initial spec for daemon memory hygiene
Merge remote-tracking branch 'origin/master'