Moves some function implementations from their headers.