added tests for flatten, fixed bug with is.recursive(NULL)
moved back to old non modular version