Implement getMarketRule and minor improvements
#231

rylorin wants to merge warnings into master

We do not currently have an analysis of these two commits