FIrst version of core library

Moved to appropriate package.
Mimimal functionality.
Not error safe.