compatible with withmock

make modl compatible with withmock mocking library.
1) change multiple var decleration, which no supported via withmock;
2) change delete to deletes to avoid overriding builtin function delete, which is used via withmock