refactor Window_manager

use smart pointers to store Windows and Buffers.
use list for Windows instead of vector.

also make it compile.