Added Union option and cleaned up documentation

Added a slightly modified version of the javascript, that allows for conflicting arrays to be union'd instead of merge'd (which just concatenates them). This is useful for when arrays need to contain unique entries. Also cleaned up the documentation.