Unit tests, some bug fixes

changed dealing with whitespace in most calls
still need to fix whitespace issues with arrays/brackets for arrays