Re: etymology, I was once told or read, perhaps in law school, that this was a corruption of the Latin phrase for mental defect or unsound mind, "non compos mentis."