octascript: add std.table.len and remove all usages of the "$" operator

Instead, we use the new function. The "#" operator will be removed.