Complete rewrite of the backend logic - much faster syncing. Mirror mode is broken. Front-end logic is very thread-unsafe and needs a rewrite later.