Finished coding detectModularity and detectBRIM... First works, second gives slightly different numbers than original paper but is probably still okay to use