Add exceptions to tree data model

Both exception-throwing and non-exception-throwing methods are now
exposed in the client library. This caused the least code churn for now,
but we should reconsider this issue later.
Fix build errors under newer gcc versions

Fix #37: compile errors on g++ 4.5 - 4.7