Update tree insertion to be non-recursive

Resolves #1

This solution takes ages to import large files; consider switching to bintrees package for a faster implementation.