Defer import time after calling Application.initialize()

to prevent cross-import problem
Replace setup.py test command to py.test