Refactoring

Moving algorithm implementations into their own directory.