Squashed commit of the following:

commit 5543c5ec64841ebbc48ac443c983a824f20bec9f
Author: Sergey Obukhov <sergey.obykhov@mailgunhq.com>
Date:   Tue Mar 11 11:57:40 2014 -0700

    fix base64 encoding