fixes to build

fixes some of the fallout of the stabilization of items in the std library and removes most of the warnings (the ones related to the move of `num` are still happening, pending our work on cargo-ifiying rust-rosetta).

I'd like to have someone else review it, because some of the changes (e.g. `find_or_insert_with` with `entry` or `append` with `extend`) are not completely trivial and alter the previous semantics.
This could actually be rewritten as:

`range(0, num).map(|_| if random() { '[' } else { ']' }).collect()`

(So `fold`, `next` and `push` are not necessary)