Xwpf refactoring

merge XWPF changes back to master