Initial work abstracting code based on gtop
Tighten up the file layout