rebase pull request #32; func script test, stacktrace logging

Addresses #31 and #17