Fix stack trace from exported function

fixes #15
Use Error.name for more meaningful stacktraces.