Feature: Supports PageFactory implementation

Added code to support PageFactory implementation. Added tests to verify the functionality didn't break. Please review and let me know.