Add SharedArray utilities, expand documentation, add a few tests

CC @amitmurthy. I'll add some annotations to explain the intent.