Resolved some dependency issues and changed abort calls for 'raise' to be compatible with rails for example