Move constrain into bitmapper.utils.

This CL adds a bitmapper.utils object for global utility function and moves the
constrain function into it.

R=jackhou@chromium.org

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