tidy up sign a bit
more performance improvements

- cleanup debug log
- drop a couple of prints
- change needless use of reentrant lock to normal lock
- only do depcopy for destructive operations
- use thread-local storage for xslt stylesheets