Revise support fragment and callbacks; add tests cases; fix bugs