Separate weight calculation from function field

Actual weight calculation should be separate from function field, this
will give provision to downstream modules to get weight in any unit.
Merge pull request #6 from tarunbhardwaj/develop

Separate weight calculation from function field