Reorganize files
Free array values in test script
Move out HashMap typedefs