Separate core functionality code into library

See https://github.com/ipavl/clorum-core