Cleaned up kernel writer and added 5 tests. Kernel writer now correctly translates sme simple loops