core: Make get_histtype accept length argument
core: Make get_histtype return HIST_DEFAULT if needed
parser/tests: Reuse `get_list_range` in `parse_clist`

It will also be used by `:history` later