Split calls to multiple files, use of build tags

The rule of thumb is:
- All pure go packages are in one file
- All calls to external programs are in one file
- There is one file for each package that uses an external library