Cleaned up some code, made typescript work with WebStorm better