Replaced those worthless hex network stuff with constants.

Converted Dungen.py to Python3, and tried to port it in Java. (It's
rather broken, though.) The server still needs the hex values replaced.