Internal code reorganization; creates xray.core module

Fixes #114 (close enough)