Merged with tchapi/Nestable and added some new features