Fixed array variable substitution, array tests.
Add docstrings

Working on #78.