Move core files to  libraries directory. Fix bug in ArrayUtil and add tests for bug fix.