uses sqlite to store the plot data

a rewrite for sqlite database usage, I didn't test it so it can crash
the server.
and it needs a lot of improvements