Added dir check to purge-build task

Signed-off-by: Tom Wright <tom@inflatablecookie.com>
Added json serialization to debug stack trace

Signed-off-by: Tom Wright <tom@inflatablecookie.com>
Added user agent helper to http plug

Signed-off-by: Tom Wright <tom@inflatablecookie.com>