Refactor function.py, move constants to config.py, init dice.py