major reorg into individual modules, some gofmt too