extract handlers and servertools to loggregator lib

Signed-off-by: Alex Jackson <ajackson@pivotallabs.com>