remove BOOST_FOREACH dependency

speed up compilation, replace BOOST_FOREACH with for
optimize array encode, initialize json_spirit with empty Array first