more of the portings. Added a modified gflags thing that works with python 3 (I hope)