Move capability management functions into another file.