use typedefs in place of lw_vector<> in most places; fixed python to check that the vector is not too big before passing it to lw_vector