Add SMA and tests. Update gitignore.