refactor back to 2 files, add command line flags

About to add a websocket.
Add a quick pass at a GetGrids() function.
stub out a websocket handler