Copied over and slightly changed the constants, peer and utils modules (and associated tests) from the drogulus project.