makekeys: Move all of the table generation to Python This makes it easier to run the Python script manually.