Code merge from actual working site code, but hasn't been sanitized at
all yet.