This adds public key support. This also moves some of the type files around or removes it, because they weren't used anymore.