Convert to class

Improve ease of storing private keys.