glh.MeshBuffer: Major overhaul of Meshbuffer.

Previously, the meshbuffer was fixed to using UNSIGNED_INT for indices
and FLOAT for all vertex data. Additionally, it always used 14 floats
to represents a single vertex, regardless of whether any of them where
ever used. This caused major space requirement overhead.

This new implementation accepts Mesh attributes as part of the buffer
constructor. These attributes define the exact type and size of each
vertex component (position, color, tex coords, normals).

This allows us to explicitly define how big each vertex component
should be and what data type it should carry. Additionally, we can define
the storage method per component. The storage method being any of
GL_STATIC_DRAW, GL_DYNAMIC_DRAW or GL_STREAM_DRAW. This gives fine grained
control over where each of the vertex components will be stored.

    mb := NewMeshBuffer(
        // Indices: 1 unsigned int per index, static data.
        NewUint32Attr(1, gl.STATIC_DRAW),

        // Positions: 2 integers, static data.
        NewInt32Attr(2, gl.STATIC_DRAW),

        // Colors: 3 floats, changing regularly.
        NewFloat32Attr(3, gl.DYNAMIC_DRAW),

        nil, // No vertex normals.
        nil, // No texture coords.
    )

This example creates a buffer which accepts 1 unsigned integer for
each index. 2 floats for the vertex position (x/y) and 3 floats
for the vertex color (r/g/b). By supplying nil for the normal
and texture-coord attributes, we are telling the buffer to omit
storage for these alltogether. These will therefor not allocate
any gl buffers, nor any excess space in the MeshBuffer itself.

The example also demonstrates how the indices and positions use
STATIC_DRAW. This means we expect them to never change. They can
therefore be stored directly in GPU memory. The Color is expected
to change, so we define it as DYNAMIC_DRAW, which stores it in
AGP memory.

Loading a mesh into this buffer us very simple:

    idx := []uint32{0, 1, 2, 3}
    pos := []int32{0, 0, 0, 0, 0, 0, 0, 0}
    clr := []float32{1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1}
    ....
    mb.Add(idx, pos, clr, nil, nil)

Note that we use the same data types for each component as was
defined in the meshbuffer attributes. And since we told it there
would be no texcoord and normal data, we supply nil for these two
in the Add() call as well.

Just like the previous version, this version uses separate buffers
for each vertex component (pos, color, texcoords, normals). Initially I
intended to merge them all into a single, interleaved buffer. I quickly
realized this would turn into a major mess to maintain. Additionally,
it would not allow us to specify the storage type for each component.

Consider the example above, where the indices and position data are
static, and the colors are expected to change regularly. When putting
all data into a single buffer, one change to a color would require us
to upload the entire data set to the GPU. With this new implementation,
that is not necessary. It is designed to notice when any of the datasets
are modified and will then automatically re-commit them to the GPU
independently.
Merge pull request #17 from jteeuwen/master

Major overhaul of Meshbuffer.