Extract array splice computation into a class

BUG=
R=rafaelw@chromium.org

Review URL: https://codereview.appspot.com/13328051