First batch of functions, unit-tests and documentation