Support selftest.py --installed, fixes #263

Courtesy of @Arfrever