Tested against Go 1.6 through Go 1.13beta1, and gccgo. Fixes #1607
Stop using relative imports and add a go.mod file. Tested against Go 1.6 through Go pre-1.13, and gccgo.
correctly. Add a test case for the problem. Fixes #339.