Scripting|libcore: Added built-in "dir" function

This works similarly to Python's "dir": returns the identifiers of the
local namespace or specified record as an array.