Big commit, various parts refactored.
Initial minimal implementation for previously removed classes.
Initial implementation of various classes.