David was originally a what before becoming king?