Restructure, update deps and fix #27