Reorganize and add util and core code.