Closes #879. shallow() gains 'cols' argument.
Added isDatatable C-function for internal use.
Remove local 'shallow' function dependency.