nunaliit2-js: Refactor logic found in couchRelated which deals with
uploading attachment when a document is created. Move this logic to a
class named "AttachmentUploadHandler"

Issue #213