Update KeyDatabase.java

Add reading/writing functionality