The functorial semantics of Lie theory