cache uses an invasive design now, a la list.h and uthash. This get rid
of the ugly integer to pointer cache, and gives us freedom of what we
can put into the cache.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
When a window is reparented to the same parent again, we should just
move it to the top of the stack, instead of add it again.
Also a slight refactor restack_win.
Fixes#164
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>