Clean up extension/page parsing code, get rid of old commented-out code