libdot: Implement common array helper functions
libdot: Implement common array helper functions

Introduces a collection of helper functions for (typed) arrays under
lib.array. Some of the functions have been extracted from existing
nassh code.

The new functions are:

* arrayBigEndianToUint32: Convert an array of four unsigned bytes into
   an unsigned 32-bit integer (big endian).
* uint32ToArrayBigEndian: Convert an unsigned 32-bit integer into an
   array of four unsigned bytes (big endian).
* concatTyped: Concatenate an arbitrary number of typed arrays of the
   same type into a new typed array of this type.
* compare: Compare two array-like objects entrywise.

BUG=chromium:712699
Change-Id: I13000ab571e26d0ce417e51fc059fe5d507d683e
Reviewed-on: https://chromium-review.googlesource.com/569158
Tested-by: Mike Frysinger <8f3f75c74bd5184edcfa6534cab3c13a00a2f794@chromium.org>
Reviewed-by: Mike Frysinger <8f3f75c74bd5184edcfa6534cab3c13a00a2f794@chromium.org>

chromium/hterm,chromium/hterm,chromium/hterm,chromium/hterm