Implement regularizers

This PR replaces #113 to set the merging target to be the dev branch. Please refer to #113 for the discussions about the design decisions.