VID-224 Make sure we don't drop categories

Also, use the getSection and replaceSection methods of the parser.
trim is a function not a variable
Merge pull request #759 from Wikia/VideoSprint24-VID-224-DisappearingCategory

VID-224 Make sure we don't drop categories