Added @safe, @trusted, pure, nothrow

Lots of TODOs in there, mostly due to other Phobos/druntime functions
not being properly annotated.