Lots of code cleanup all across the files

Made everything pythonic and fixed some references
Still lots of references to fix