refine dir, add web2py.dal support