Refactored Handlebars integration to simplify page context
Added serialize method