clean up some analysis warnings, move main stuff in to a package