master as of 19-Sep-2014
various cleanup stuff
master as of 21-Sep-2014
number theory functions and stuff