Tidy up

Updated build and fixed many, many lint warnings.