[merge] Various console changes

This changes the following things:
- Makes console threadsafe
- Makes console a normal object (no singleton)
- Allow lambdas as callback
- Minor other changes