Moves more functions over to lib js.