Reorganized the source code and removed Sysouts which are not needed.
Needed sysouts are logged now. Made chooseBaseDocument and
chooseBaseText protected.