Rewrite dynamic array (LbsArray) and add test suite