Some additions/refactoring. Added define checking. Added RDynamicArray methods. UNSTABLE!