Adds a new export method called attach

adds tests for attach and some minor improvements to others
moved doc comments to separate file
updated copy task to include source map files