Remove lots of dead code
Add check for datatype overflows
use native datatype indices instead of fixed 16bit/32bit ones
Merge commit 'f4f98c9' into merge2

Conflicts:
	src/client.cpp