clone of https://github.com/army8735/homunculus/blob/master/src/util/Class.js