Refactor models

This a big refactor

- use rails4-way refactoring model modules
- rename `authenticate` and made them more clearly
- remove `Application` model's `model_name` magic
- extract model's non-ORM-specify codes to module(a way to decouple between ORM and model)
- some clean up

The PR may not be merged, but may give some ideas to discussion
If we can't figure out why or leave better syntax, please leave a comment explaining why we do it this way, something like "this shouldn't be needed, but for some reason in these cases it wouldn't work otherwise", and links to Github and Travis CI if possible. Thank you!