Add bufnr segment

Ref #705
Add winnr segment

Closes #705
Merge pull request #950 from ZyX-I/bufwinnr-segments

Add buffer and window number segments