Rewrite core library and delete unused commands