array: make arrays stack allocated and add clear function.