Generalize BufferTypePicker
Previously there was a bug where BufferTypePicker was not implemented correctly when LONG was 32 bits (even though 64 bit integers were available).
This changes fixes the problem and also makes the implementation more general by using the TypeTraits already available.