Transaction end fix

This is to fix Issue #325 and Issue #326 so that remote refs are copied over on endTransaction. I also switched the response for unexpected exceptions to return a 5 line stack trace instead of just a uuid to help me with debugging the web-api if a command failed.