some doc updates and some more testing

moved examples to unittests

DmitryOlshansky fix
Merge pull request #2630 from burner/array_replace_doc

some doc updates for std.array and some more testing