Cleaned up casper code, starting to port to spooky