Adding tests, making the code more DRY and fixing a couple small things