Replacement fixes and apex:page flags configuration

- Fixing some issues with the tag replacement
- Adding replacement of Doctype tag
- Adding first part of apex:page flags configuration (work in progress)