Deque 1.0.0

Fix several bugs and clean up code