Moved most localhost code into local.go