added methods for handling binary files and storing binary data in messages

Ignore-this: dbde6c6d83a39f6dec86258264548ec9

This is a step in implementing functionality to support file transfer apps

darcs-hash:20131119151418-c21fe-fd11415d996e6e443dc37c9dec152f350abc241c