Cleaned up dbscan test script and fixed bugs in DBSCAN expand_cluster

Sorry it took me so long to get to this. The test script should be working now. I also discovered a bug in the main dbscan algorithm that is now fixed. I'm not sure why it's showing the entire file as changed, rather than just the few lines that I edited - it may be because I'm working in linux/emacs now, while the original files were written in Windows.