resolves #337 set doctitle attribute

- also fix doctitle and header title logic
- better test cases for doctitle and header title
Merge pull request #338 from mojavelinux/doctitle

resolves #337 set doctitle attribute