Switched over to preparedstatments.

Signed-off-by: Lucas Arnström <lucasarnstrom@gmail.com>
Now uses prepared statements to improve performance.

Signed-off-by: Lucas Arnström <lucasarnstrom@gmail.com>
Switched over to hashset to reduce memory usage.

Signed-off-by: Lucas Arnström <lucasarnstrom@gmail.com>