Move code into util.
Move functions into namespace.
Move buildSlice into panel namespace.