Restructure code into Go packages.