Finished porting from php
Cleaned up .gitignore