Add stacktrace factory. Resolves #1.