merged version of #2483, with websql fix

Replace jkmyers-md5 with Spark-MD5 in order to calculate MD5 hashes
incrementally. The use-case for this change is to avoid blocking the UI
thread when adding large attachments.