Ref redesign, part 1

- Moved string and numeric mapregs into the same DBMap (for consistency
  with the other reg types.)

Signed-off-by: Haru <haru@dotalux.com>
Ref redesign, part 2

- Reorganized regs var/array DBMaps into a specific reg_db structure

Signed-off-by: Haru <haru@dotalux.com>
Ref redesign, part 3

- Updated several functions to properly use the data structures defined
  in parts 1 and 2.
- Special thanks to Ind for his help on this, as well as the previous
  two parts.
- Fixes some crashes related to variable references passed back and
  forth between nested callfunc/callsub scopes (related: 2669e9a,
  3259f89, 4f2de07)

Signed-off-by: Haru <haru@dotalux.com>
Corrected same-reference check to work on vars with the same name in different scopes

- Fixes bugreport:8008, special thanks to KeyWorld
  http://hercules.ws/board/tracker/issue-8008-copyarray-fail-on-a-referenced-array-argument/

Signed-off-by: Haru <haru@dotalux.com>
Added some callsub tests to the script testsuite

- Also includes testcases for the recent ref fixes/changes.

Signed-off-by: Haru <haru@dotalux.com>