updated style and names of ncursesbuf.hpp.

1. updated coding style.
2. updated namespace names and namespace declerations.
3. split template implementation into seperate file.