Rewrote baker.sh to use keypair

Implementation is not very good, but seems to work in all of my tests.