initial commit, extracted from leveljs