Move some force and optimization routines to core