Much cleanup; core no longer depends on jquery