added 'fmt' to 'libraries'
Fix empty message runtime panics

Anytime an empty message was offered for signing, the cgo translation
would point to the first element of an empty slice and cause a runtime
panic. I added some code to prevent this.

I also cleaned up the functions a bit. It's still not pretty but perhaps
easier to understand what is happening.
Switch consts from ALLCAPS to CamelCase