core: Move mkdir_recursive from rustpkg into core::os

mkdir_recursive creates a directory as well as any of its
parent directories that don't exist already. Seems like a useful
thing to have in core.
core: Document core::path::GenericPath's trait methods
core: Use a better termination condition in os::mkdir_recursive

Instead of checking whether the parent is "." or "/", check the
number of components.

Also, more tests.
DO NOT COMMIT: reverting