I20171117-2000
Replaced a few array lists with linked hash sets, since the array lists were used as sets. This resulted in quadratic complexity for some operations. Complexity is now (expected) linear. Change-Id: I54be6e2019c90603d03a76659256d7270aacadfb Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>