Added attachment support

@jreyes, making this the pull request now because need to adjust some things. Thanks again for all this and feel free to add comments as I go.