Fixed up a lot of problems, much faster now.

Still fixing up the time slice functionality. Moving the parameter
setting to the sonar config gui, not complete yet.