TermUtils.toInt(Term) works with structures representing arithmetic functions - resolves #31