Refactored major parts of the content system.