rewrite to be a library of functions instead of classes and objects

Signed-off-by: Steven Armstrong <steven.armstrong@id.ethz.ch>