Added a few functions from BFG's idlib. Probably temporary while i figure out if i want to add BFG's GLSL backend.

New template for creating dynamic arrays.

Signed-off-by: revelator <ralphengels@gmail.com>