Added simple trees and fixed the code a little to get it ready for the chunks-in-the-memory thing.