Remove _currentNode global, made truly recursive

* This fixes the issue with multiple trees in one file not being
counted, fixes #1
Added tests and test file for multi tree configs