fix some gaia bugs and add RefObject's test case
gaia framework impl